﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using Provausio.Common.Objects;
using TrainingManagement.api.Models.BusinessObjects;
using Provausio.Common.Utility.Extensions;

namespace TrainingManagement.api.Models.Data.Readers
{
    public class DepartmentDataReader : BusinessOperation<IDataRecord, Department>
    {
        public override Department Run(IDataRecord input)
        {
            var dept = new Department();
            dept.Title = input["Title"].ToString();
            dept.DepartmentId = input["DepartmentID"].DbTo<int>();
            return dept;
        }
    }
}